package 字符串;

/**
 * @Author Weton Li
 * @Date 2021/4/1 18:16
 */
public class 反转字符串 {

    public static void method(char[] numsC){
        int left = 0;
        int right = numsC.length-1;
        while (left < right) {
            char temp = numsC[left];
            numsC[left] = numsC[right];
            numsC[right] = temp;

            left++;
            right--;
        }
    }
    public static void main(String[] args) {
        char[] input = {'h','e','l','l','o'};
        method(input);
        for (char c : input) {
            System.out.println(c);
        }
    }
}
